/**
 * 
 */
package models;

import javax.swing.Timer;

import controllers.EventGeneratorTimerListener;

/**
 * @author LAP
 *
 */
public class UpdateProgressTimer extends Timer {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2312853809661830466L;
	
	JProgressPanelDefaultModel defaultModel;
	
	/**
	 * @param defaultModel the generator to set
	 */
	private void setDefaultModel(JProgressPanelDefaultModel defaultModel) {
		if (defaultModel == null) throw new NullPointerException("Generator must be not null");
		this.defaultModel = defaultModel;
	}

	/**
	 * @return the generator
	 */
	public JProgressPanelDefaultModel getDefaultModel() {
		return defaultModel;
	}

	public UpdateProgressTimer(int delay, JProgressPanelDefaultModel generator) {
		super(delay, new EventGeneratorTimerListener());
		setDefaultModel(generator);
	}
	
	
}
